﻿CREATE TABLE [dbo].[ParteDiarioPersonal](
	[ParteDiarioPersonalId] [int] IDENTITY(1,1) NOT NULL,
	[AgenteId] [int] NOT NULL,
	[DiaJustificar] [date] NULL,
	[PeriodoDesde] [date] NULL,
	[PeriodoHasta] [date] NULL,
	[Observaciones] [varchar](250) NULL,
	[CodigoAusentismoId] [int] NOT NULL,
	[ParteQuincenalPersonalId] INT NOT NULL, 
	[Activo] BIT NOT NULL DEFAULT (1),
    CONSTRAINT [PK_ParteDiarioPersonal] PRIMARY KEY CLUSTERED ([ParteDiarioPersonalId] ASC) WITH (FILLFACTOR = 80),
	CONSTRAINT [FK_ParteDiarioPersonal_Agente] FOREIGN KEY ([AgenteId]) REFERENCES [dbo].[Agente] ([AgenteId]),
	CONSTRAINT [FK_ParteDiarioPersonal_ParteQuincenalPersonal] FOREIGN KEY ([ParteQuincenalPersonalId]) REFERENCES [dbo].[ParteQuincenalPersonal] ([ParteQuincenalPersonalId]),
	CONSTRAINT [FK_ParteDiarioPersonal_CodigoAusentismo] FOREIGN KEY ([CodigoAusentismoId]) REFERENCES [dbo].[CodigoAusentismo] ([CodigoAusentismoId])
)
